<?php

/**
 * @version		$Id$
 * @package		Joomla.Administrator
 * @subpackage	JoomDOC_2
 * @author      ARTIO s.r.o., info@artio.net, http:://www.artio.net
 * @copyright	Copyright (C) 2011 Artio s.r.o.. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die();

jimport('joomla.filesystem.file');

// JoomDOC_2 defines
include_once(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomdoc_2' . DS . 'defines.php');
// JoomDOC_2 Joomla 1.6 and higher adapter
include_once(JPATH_ROOT . DS . 'components' . DS . 'com_joomdoc_2' . DS . 'assets' . DS . 'j16' . DS . 'index.php');
// JoomDOC_2 framework prepare to auto load
JLoader::register('JoomDOC_2FileSystem', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomdoc_2' . DS . 'libraries' . DS . 'joomdoc_2' . DS . 'filesystem' . DS . 'filesystem.php');
JLoader::register('JoomDOC_2Config', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomdoc_2' . DS . 'libraries' . DS . 'joomdoc_2' . DS . 'application' . DS . 'config.php');
JLoader::register('JoomDOC_2ModelList', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomdoc_2' . DS . 'libraries' . DS . 'joomdoc_2' . DS . 'application' . DS . 'component' . DS . 'modellist.php');
JLoader::register('JoomDOC_2View', JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_joomdoc_2' . DS . 'libraries' . DS . 'joomdoc_2' . DS . 'application' . DS . 'component' . DS . 'view.php');
// JoomDOC_2 language
$language =& JFactory::getLanguage();
/* @var $language JLanguage */
$language->load(JOOMDOC_OPTION, JPATH_ADMINISTRATOR, 'en-GB');
$language->load(JOOMDOC_OPTION, JPATH_ADMINISTRATOR, $language->getTag(), true);
// set paths to load JoomDOC_2 core classes
JHtml::addIncludePath(JOOMDOC_HTML);
JModel::addIncludePath(JOOMDOC_MODELS);

class JElementParents extends JElement {

    var $_name = 'Parents';

    /**
     * Display element.
     *
     * @param string $name form field name
     * @param mixed $value field saved value
     * @param JSimpleXMLElement $node field XML setting
     * @param string $control_name form field array
     * @return string
     */
    function fetchElement ($name, $value, &$node, $control_name) {
        return JHtml::_('joomdoc_2.parents', $value, $control_name . '[' . $name . ']', $control_name . $name);
    }
}
?>